package cn.getech.data.metadata.model.res.collectiontablestatistics;

import com.google.common.collect.Sets;
import lombok.Data;

import java.util.Date;
import java.util.Set;


@Data
public class RelationTable {
    //表名
    private String tableName;
    // 上下游关系, type=1 上游；type = 0 下游
    private Integer type;
    //字段名
    private Set<RelationField> fieldList= Sets.newHashSet();

    private Integer tableId;

    private String dbName;
    private String dbType = "Hive";
    private Integer ico = 0;

    private Date createTime;
    private Date updateTime;
    private String createUserName;

    public RelationTable copyBean(RelationTable source) {
        if (source == null) {
            return new RelationTable();
        }
        this.tableName = source.getTableName();
        this.type = source.getType();
        this.tableId = source.getTableId();
        this.dbName = source.getDbName();
        this.dbType = source.getDbType();
        this.ico = source.getIco();
        this.createTime = source.getCreateTime();
        this.updateTime = source.getUpdateTime();
        this.createUserName = source.getCreateUserName();
        return this;
    }
}
